package com.interest.base.common;


import com.sun.deploy.util.StringUtils;

import java.util.Collection;

/**
 * Created by yangfeng on 16-11-15.
 */
public class BuilderUtil {
    private static final String UNDER_SCORE = "_";
    private static final String MINUS_SIGN = "-";

    public static final String[] getUnderSegments(String text) {
        return getSegments(text, UNDER_SCORE);
    }

    public static final String[] getMinusSegments(String text) {
        return getSegments(text, MINUS_SIGN);
    }

    public static final String underJoin(Collection segmetns) {
        return StringUtils.join(segmetns, UNDER_SCORE);
    }

    private static final String[] getSegments(String text, String delimiter) {
        return StringUtils.splitString(text, delimiter);
    }
}
